let arr:[undefined,string,number,string,number,string,null,number] = [undefined,"23year",19,"097",1,"hello",null,1]


function getSum(arr:any):number{
    let num:number[]=[];
    let sum:number=0;
    for(let item of arr){
        if(typeof item === 'number' && num.indexOf(item) == -1){
            num.push(item)
            sum+=item;
        }
    }
    return  sum
}

console.log(getSum(arr));
